import require from '@/utils/request.js'
import {
  setUrl
} from '@/utils/util'

// 获取动态验证码
export function employee() {
  return require({
    url: '/employee/getImgCode',
    method: 'get'
  })
}

// 校验动态验证码
export function isCode(code) {
  return require({
    url: `/employee/isCode?code=${code}`,
    method: "get"
  })
}


// 获取列表
export function getFields(data) {
  return require({
    url: `/employee/getFields/${data.id}?employeeType=${data.employeeType}`,
    method: 'get'
  })
}

// 登录
export function login(data) {
  return require({
    url: '/employee/login',
    method: 'post',
    data
  })
}

// 获取短信验证码
export function sendMsg(data){
  const url = setUrl('/employee/sendMsg',data)
  return require({
    url,
    method:'post',
    data
  })
}

// 获取国家地区
export function getCityAll(data = {}) {
  const url = setUrl('/employee/getCityAll', data)
  return require({
    url,
    method: 'get'
  })
}
